"""
Author: wenbin
Create: 2024-08-17
"""
from wtforms import StringField
from wtforms.validators import DataRequired, Length

from app.validator import BaseForm


class ValidCreateApp(BaseForm):
    """校验创建应用参数"""
    name = StringField(validators=[
        DataRequired(message="应用名称不允许为空"),
        Length(max=50, message="应用名称最大长度为 50")
    ])
    icon = StringField(validators=[
        DataRequired(message="应用图标不允许为空")
    ])
    description = StringField(validators=[
        DataRequired(message="应用描述不允许为空")
    ])


class ValidDebug(BaseForm):
    """校验调试参数"""
    question = StringField(validators=[
        DataRequired(message="用户提问不允许为空"),
        Length(max=2000, message="用户提问的最大长度为 2000")
    ])
